package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * 新增口味
     * @param flavors
     */
    void insertDishFlavor(List<DishFlavor> flavors);

    /**
     * 根据dishId查询数据
     * @param dishId
     * @return
     */
    @Select("select id, dish_id, name, value from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> selectDishFlavorByDishId(Long dishId);

    /**
     * 根据dishIds删除数据
     */
    void deleteDishFlavorByDishIds(Long[] dishIds);

    /**
     * 根据dishId返回DishFlavor集合
     * @param DishId
     * @return
     */
    List<DishFlavor> getByDishId(Long DishId);
}
